/**
 * Copyright (C) 2013-2015
 *
 * @file   S_2_Curtain_doChange.c
 *
 * @remark
 *
 */

#include "S_2_Curtain_doChange.h"
#include "miio_user_api.h"
#include "iid.h"


uint8_t P_2_2_CurrentPosition_doChange(uint32_t newValue)
{
    uint8_t ret = 1;
    if (miio_properties_changed(2, 2, property_value_new_ulong(newValue)) != 0)
    {
        ret = 0;
        MI_LOG_ERROR("send_property_changed failed!\n");
    }
    return ret;
}


uint8_t P_2_3_TargetPosition_doChange(uint32_t newValue)
{
    uint8_t ret = 1;
    if (miio_properties_changed(2, 3, property_value_new_ulong(newValue)) != 0)
    {
        ret = 0;
        MI_LOG_ERROR("send_property_changed failed!\n");
    }
    return ret;
}


uint8_t P_2_4_MotorReverse_doChange(bool newValue)
{
    uint8_t ret = 1;
    if (miio_properties_changed(2, 4, property_value_new_boolean(newValue)) != 0)
    {
        ret = 0;
        MI_LOG_ERROR("send_property_changed failed!\n");
    }
    return ret;
}


uint8_t P_2_5_SpeedLevel_doChange(uint32_t newValue)
{
    uint8_t ret = 1;
    if (miio_properties_changed(2, 5, property_value_new_ulong(newValue)) != 0)
    {
        ret = 0;
        MI_LOG_ERROR("send_property_changed failed!\n");
    }
    return ret;
}

